首页>代码>spring mvc+spring+mybatis框架整合开发基于角色到按钮级别的java权限后台管理系统>/rbps Maven Webapp/src/main/java/dingzhen/controller/AttachmentController.java
package dingzhen.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONObject;

import dingzhen.entity.Attachment;
import dingzhen.service.AttachmentService;
import dingzhen.util.WriterUtil;

/**
 *@author: wangq
 *@date: 2015-8-11下午03:18:56
 *@version:
 *@description:
 */
@Controller
@RequestMapping("attachment")
public class AttachmentController {

	@Autowired
	private AttachmentService<Attachment> attachmentService;
	private int page = 1;
	private int rows = 10;
	private Attachment attachment;
	
	
	@RequestMapping("attachmentList")
	public void list(HttpServletRequest request,HttpServletResponse response){
		try {
			page = Integer.parseInt(request.getParameter("page"));
			rows = Integer.parseInt(request.getParameter("rows"));
			attachment = new Attachment();
			attachment.setPage((page-1)*rows);
			attachment.setRows(rows);
			List<Attachment> list = attachmentService.findAttachment(attachment);
			int total = attachmentService.countAttachment(attachment);
			JSONObject jsonObj = new JSONObject();
			jsonObj.put("total",total );
			jsonObj.put("rows", list);
	        WriterUtil.write(response,jsonObj.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	
}
最近下载更多
vitos5n  LV9 2023年5月22日
wanglinddad  LV54 2022年4月24日
liujun0104  LV4 2022年3月29日
做你的英雄  LV14 2022年3月14日
Start1  LV15 2022年3月8日
1214955637  LV2 2021年1月2日
泪染珍珠  LV9 2020年11月3日
wangxc87  LV1 2020年8月3日
吴鑫1998  LV9 2020年6月23日
zhangtian1997  LV10 2020年6月7日
最近浏览更多
wddq123 4月3日
暂无贡献等级
WBelong  LV7 2023年12月26日
漫步的海星  LV4 2023年9月21日
飞呀飞呀飞不放  LV7 2023年8月9日
zhy1989wz  LV6 2023年7月6日
1379585889  LV11 2023年6月7日
zhaoqfan  LV2 2023年5月15日
hao2290211  LV1 2023年4月14日
uni-code_0123  LV1 2023年3月23日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友